package router

import (
	"blizzard/app/api"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

func init() {
	s := g.Server()
	s.Group("/cardType", func(group *ghttp.RouterGroup) {
		group.ALL("/list", api.CardType.List)
	})
	s.Group("/admin", func(group *ghttp.RouterGroup) {
		group.POST("/login", api.Admin.Login)
		group.POST("/logout", api.Admin.Logout)
		group.POST("/card/addtype", api.CardType.Add)
		group.POST("/card/add", api.Card.Add)
	})
	s.Group("/app", func(group *ghttp.RouterGroup) {
		group.POST("/add", api.App.Add)
		group.POST("/change", api.App.Change)
		group.POST("/addBlack", api.App.AddBlack)
		group.POST("/getInfo", api.App.GetInfo)
		group.POST("/list", api.App.ListAll)
		group.POST("/getInfoAll", api.App.GetInfoAll)
	})
	s.Group("/user", func(group *ghttp.RouterGroup) {
		group.POST("/register", api.User.Register)
		group.POST("/recharge", api.User.Recharge)
		group.POST("/passchange", api.User.PassChange)
		group.POST("/login", api.User.Login)
		group.POST("/logout", api.User.Logout)
		group.POST("/unbind", api.User.UnBind)
		group.POST("/trial", api.User.Trial)
		group.POST("/heart", api.User.Heart)
		group.POST("/queryCard", api.User.QueryCard)
	})
	s.Group("/signCard", func(group *ghttp.RouterGroup) {
		group.POST("/login", api.SignCard.Login)
		group.POST("/logout", api.SignCard.Logout)
		group.POST("/heart", api.SignCard.Heart)
		group.POST("/unbind", api.SignCard.Unbind)
		group.POST("/getData", api.SignCard.GetCardData)
		group.POST("/setData", api.SignCard.SetCardData)
		group.POST("/getInfo", api.SignCard.GetCardInfo)
	})
	s.Group("/signView", func(group *ghttp.RouterGroup) {
		group.POST("/add", api.SignView.Add)
		group.POST("/list", api.SignView.List)
	})
	s.Group("/card", func(group *ghttp.RouterGroup) {
		group.POST("/list", api.Card.List)
	})
}
